﻿using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace SvnDeploy.Service
{
    [RunInstaller(true)]
    public class SvnDeploymentServiceInstaller : Installer
    {
        public SvnDeploymentServiceInstaller()
        {
            var processInstaller = new ServiceProcessInstaller();
            var serviceInstaller = new ServiceInstaller();

            // Account information
            processInstaller.Account = ServiceAccount.LocalSystem;
            processInstaller.Username = null;
            processInstaller.Password = null;

            // Service information            
            serviceInstaller.ServiceName = SvnDeploymentService.SERVICE_NAME;
            serviceInstaller.DisplayName = "SVN Deployment Service";
            serviceInstaller.Description = "SVN Deployment Service";
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            
            // Register installers
            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
        }
    }
}
